package com.shg.bean.bbs;

import java.io.Serializable;
import java.util.Date;
import java.util.Set;

import com.shg.bean.Book;
import com.shg.bean.Users;

public class Forum implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	//论坛的ID
	private String id;
	//回帖时间
	private  Date times=new Date();
	//浏览次数
	private Integer browse=1;
	//状态(0表示允许公开)
	private Integer state=0;
	//文章的标题
	private String title;
	//内容
	private String content;
	//所属父类
	 private Forum parent;
	 //贴子的知名度
	 private Integer love;
	 //其子类
	 private Set<Forum> child;
	 //回帖人
	 private Users users;
	 //所属书籍
	 private Book book;
	 
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public Date getTimes() {
		return times;
	}
	public void setTimes(Date times) {
		this.times = times;
	}
	public Integer getBrowse() {
		return browse;
	}
	public void setBrowse(Integer browse) {
		this.browse = browse;
	}
	public Integer getState() {
		return state;
	}
	public void setState(Integer state) {
		this.state = state;
	}
	public Integer getLove() {
		return love;
	}
	public void setLove(Integer love) {
		this.love = love;
	}
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	public Forum getParent() {
		return parent;
	}
	public void setParent(Forum parent) {
		this.parent = parent;
	}
	public Set<Forum> getChild() {
		return child;
	}
	public void setChild(Set<Forum> child) {
		this.child = child;
	}
	public Users getUsers() {
		return users;
	}
	public void setUsers(Users users) {
		this.users = users;
	}
	public Book getBook() {
		return book;
	}
	public void setBook(Book book) {
		this.book = book;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Forum other = (Forum) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		return true;
	}
	
}
